The subject application is directed generally to conversions between color spaces. The application is particularly directed to conversion of color space values which lie outside of a traditional color space boundary.
Image data is typically stored as pixel data encoded in a multidimensional color space. Several of the device-independent color spaces in common use for color science and engineering, including digital color management systems, are based on recommendations by the Commission Internationale de l'Eclairage (CIE), a standards organization. The formulas used for the definition of CIE spaces were originally concerned with only those numerical qualities representing colors visible to the human visual system. However, modern hardware and software systems often need to operate on quantities outside the valid range of these formulae.
It will be appreciated by those skilled in the art that a singularity in a mathematical function or formula is a place in the domain where the function is undefined or ill behaved (for instance, unbounded or infinite), e.g. quantities outside the valid range of these formulae or functions. The most common kind of singularity occurs when the denominator of a fraction is zero, since division by zero is not defined.
The skilled artisan will further appreciate that singularities are quite common in formulae, and often do not present a problem, because most formulas are only expected to be used in restricted regions where the denominators are guaranteed to be non-zero. For example, the denominators are “bounded away from zero”, i.e. they are above some minimum non-zero value.
In some instances, a formula that has been constructed or devised for use in such a restricted region will, at a later date, have to be used outside that region. Such use may result in an encounter with singularities. For example, in a digital system, if the hardware is ordered to divide something by zero, it will normally respond with a machine fault, e.g. possible crash of the system. Typically, though, the system software will detect the fault and take some appropriate action. The system may abort the application program and display an error message, or be able to recover and proceed in spite of the fault.
Even if the denominator is not zero, there may be a problem if the denominator is very small: The division may result in a quantity that is too big to be represented in the digital hardware, because of the limited bit-precision. This may produce an “overflow” condition—another kind of fault.
Applications programmers try to anticipate these problems by testing the denominator before the division and providing an alternative computation, so that machine faults are avoided. The most common way to accomplish this avoidance is by implementation of “clipping”, i.e. if the denominator is less than a specified clipping value (typically very small), it is replaced by that value. The skilled artisan will thus appreciate that a singularity will not be encountered during the computation.
Unfortunately, while such clipping may prevent the aforementioned machine faults, the clipping may create other problems for the actual computation. The abrupt replacement of the original denominator by the clipping value may destroy the smoothness of the result. As will be appreciated by those skilled in the art, some algorithms do not work well unless the function behaves smoothly. Also, the modified function will not have a well-defined inverse in the region where the denominator has been clipped.